<?php

/*

  Action	$2

  +$2
  Trash this card. Put an Embargo token on top of a Supply pile.
  When a player buys a card, he gains a Curse card per Embargo token on that pile.

 */

class Embargo extends Card implements iAction, iKingdom, iSeaside {

    public function __construct() {
        parent::__construct("Embargo", 2);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+$2",
            "Trash this card. Put an Embargo token on top of a Supply pile.  When a player buys a card, he gains a Curse card per Embargo token on that pile.");
    }
    
    public function play(Game $game, $isRealCard) {
        $game->addMoney(new Price(2));
         ScreenDisplay::addScreenMessage($game, true, "get +2$", "gets +2$");

		$embargo = $game->moveCardFromPileToPile($this, PlayArea, Trash);
		ScreenDisplay::addScreenMessage($game, true, "trash ".  nicePrint($embargo), "trashes ". ScreenDisplay::$LMSG);

        $cards = $game->getBoardCardsByPrice();
        $output = MySocket::GetUserReply($game, Input_ChooseOne, $cards, 1, 1, null, "Choose cards to embargo");

        $card_name = $output[0];
        $game->embargoCard($card_name);
         ScreenDisplay::addScreenMessage($game, true, "embargo ".  nicePrint($output), "embargos ". ScreenDisplay::$LMSG);

        $game->cardActionFinished();
        return true;
    }

}

?>